package com.carrental.api.ums.controller;

import com.carrental.api.ums.domain.bo.UmsLoginBo;
import com.carrental.api.ums.domain.bo.UmsRegisterBo;
import com.carrental.api.ums.service.IUmsUserLoginService;
import com.carrental.common.response.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author LiangYi
 * @since 2022/3/28 20:18
 */
@Api(tags = "会员注册")
@RestController
@RequestMapping("/ums")
public class UmsRegisterController {
    @Autowired
    private IUmsUserLoginService loginService;

    @ApiOperation("注册")
    @PostMapping("/register")
    @Transactional(rollbackFor = Exception.class)
    public CommonResult<Boolean> register(@RequestBody UmsRegisterBo registerBo){
        return CommonResult.success( loginService.register(registerBo));
    }
}
